<?php

namespace aerovuelos\PersonaBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface;

class PersonasType extends AbstractType {

    public function buildForm(FormBuilderInterface $builder, array $options) {
        $builder
        ->add('apellido')
        ->add('nombre')
        ->add('nroDoc')
        ->add('email')
        ->add('telefono')
        ->add('sexo', 'choice', array(
        'choices' => array( 'M' => 'Masculino','F' => 'Femenino' ),
        'multiple' => false,
        'expanded' => true,
        'required' => true,))
        ->add('tipoDoc',null, array(
                    'required' => true,
                    'attr' => array('class' => 'uniform')))
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver) {
        $resolver->setDefaults(array(
            'data_class' => 'aerovuelos\PersonaBundle\Entity\Personas'
        ));
    }

    public function getName() {
        return 'personas';
    }

}
